The purpose of this paper is to use the harmony search algorithm to solve the scheduling problem of flexible job shop, with the goal of minimizing the maximum completion time. The issue of flexible workshop scheduling is an important research content in the field of production operation management. It involves how to rationally arrange the processing sequence of different jobs on different machines to optimize production efficiency. As a heuristic optimization algorithm, the harmony search algorithm performs well in solving complex optimization problems with its good global search ability and robustness. This paper first establishes a mathematical model of the scheduling problem of flexible job shop, and expounds in detail the basic principle and process of the harmonic search algorithm. Subsequently, we designed a scheduling strategy based on the harmony search algorithm, and by adjusting the algorithm parameters and strategies, we realized the effective optimization of the maximum completion time. The experimental results show that the algorithm can significantly reduce the maximum completion time and improve production efficiency when solving the scheduling problem of flexible work workshops. The research in this paper not only provides a new solution method for the scheduling problem of flexible job shop, but also provides a useful reference for the application of harmonic search algorithm in similar problems.